package com.woniu.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.woniu.utils.BaseController;
import com.woniu.utils.MyPage;
import com.woniu.vo.QueryVo;
import com.woniu.entity.Auction;
import com.woniu.service.AuctionService;

@Controller
@RequestMapping("/auction/Auction")
public class AuctionController extends BaseController {
	@Autowired
	private AuctionService auctionService;
	
	
	// --分页查询
				@RequestMapping("/selectByPage")
				@ResponseBody  
				public MyPage<QueryVo> selectByPage(int pageNum,int pageSize,String goodstatus) {
					MyPage<QueryVo> page = auctionService.selectByPage(pageNum,pageSize,goodstatus);
					return page;
				}
				
				@RequestMapping("/selectById")
				@ResponseBody
				public QueryVo selectById(Integer aid) {
					QueryVo vo = auctionService.selectAuctionById(aid);
					return vo;
				}
				@RequestMapping("/editBuyerStatus")
				public String updateStatusById(Integer aid,String userstatus) {
					auctionService.updateStatusById(aid,userstatus);
					return "paipai/adminiframe/auction";
				}
				
				@RequestMapping("/selectBuyerInfo")
				@ResponseBody
				public QueryVo selectBuyerInfo(Integer aid) {
					QueryVo vo = auctionService.selectBuyerInfoById(aid);
					return vo;
				}
				
				@RequestMapping("/selectRecord")
				@ResponseBody
				public QueryVo selectRecord(Integer aid) {
					QueryVo vo = auctionService.selectRecordById(aid);
					return vo;
				}


}